<?php

namespace App\Model\Blog;

use Illuminate\Database\Eloquent\Model;

class Categories extends Model
{
    /**
     * Posts retorna todas as postagens referente a categoria
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function Posts()
    {
        return $this->belongsToMany(Post::class, 'categories_posts', 'category_id', 'post_id');
    }
}
